package com.wangshouyu.mp.message;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.wangshouyu.mp.miniprogram.Miniprogram;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月07日 13:44
 * @description 小程序消息
 */
public class MiniProgramMessage extends Miniprogram {

    /**
     * 标题
     */
    private String title;

    /**
     * 封面id
     */
    @SerializedName(value = "thumb_media_id")
    @JsonProperty(value = "thumb_media_id")
    @JSONField(name = "thumb_media_id")
    private String thumbMediaId;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getThumbMediaId() {
        return thumbMediaId;
    }

    public void setThumbMediaId(String thumbMediaId) {
        this.thumbMediaId = thumbMediaId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MiniProgramMessage that = (MiniProgramMessage) o;
        return Objects.equals(title, that.title) && Objects.equals(thumbMediaId, that.thumbMediaId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(title, thumbMediaId);
    }

    @Override
    public String toString() {
        return "MiniProgramMessage{" +
                "title='" + title + '\'' +
                ", thumbMediaId='" + thumbMediaId + '\'' +
                '}';
    }
}
